<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Flex布局案例2-微信聊天界面</title>
    <style>
        /* *{
            padding: 0;
            margin: 0;
        }
        body,html{
            height: 100%;
            width: 100%;
        } */

        
        /* 盒子 */
        .box{
            width: 300px;
            height: 600px;
            background-color: rgb(243, 232, 223);
            margin-left: auto;
            margin-right: auto;
            display: flex;
            flex-direction: column;
        }

        /* 盒子上 */
        .box .top{
            height: 50px;
            background-color: #b450f7;
            text-align: center;
            line-height: 50px;
            font-weight: 700;
        }

        /* 盒子下 */
        .box .bottom{
            height: 30px;
            background-color: black;
        }

        /* 盒子中间 */
        .box .center{
            flex: auto;
        }

        /* 微信聊天框 */
        .dot{
            height: 50px;
            background-color: seashell;
            display: flex;
            flex-direction: row;
            border-bottom: 1px solid #b2b2b2;
        }
        .left{
            width: 50px;
            /* background-color: skyblue; */
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
        }
        .middle{
            flex: auto;
        }
        .right{
            width: 100px;
            /* background-color: skyblue; */
            color: dimgrey;
            font-size: 12px;
            text-align: right;
            display: flex;
            flex-direction: row;
            align-items: flex-start;
            justify-content: flex-end;
            margin-right: 10px;
            margin-top: 10px;
        }
        img{
            width: 40px;
            height: 40px;
            border-radius: 50%;
        }

        /* 框里 */
        .up{
            font-weight: 700;
            margin-top: 5px;
            margin-left: 5px;
        }
        .down{
            font-size: 12px;
            color: dimgrey;
            margin-left: 5px;
        }
    </style>

</head>
<body>
    <div class="box">
        <div class="top">微信</div>
        <div class="center">
            <div class="dot">
                <div class="left">
                    <img src="./蜡笔小新.jpg" alt="">
                </div>
                <div class="middle">
                    <div class="up">H</div>
                    <div class="down">巴拉拉小魔仙</div>
                </div>
                <div class="right">
                    <div>10:27</div>
                </div>
            </div>
            <div class="dot">
                <div class="left">
                    <img src="./蜡笔小新.jpg" alt="">
                </div>
                <div class="middle">
                    <div class="up">H</div>
                    <div class="down">巴拉拉小魔仙</div>
                </div>
                <div class="right">
                    <div>10:27</div>
                </div>
            </div>
            <div class="dot">
                <div class="left">
                    <img src="./蜡笔小新.jpg" alt="">
                </div>
                <div class="middle">
                    <div class="up">H</div>
                    <div class="down">巴拉拉小魔仙</div>
                </div>
                <div class="right">
                    <div>10:27</div>
                </div>
            </div>
        </div>
        <div class="bottom"></div>

    </div>
    
</body>
</html>